#ifndef COMPLEX_NUMBER_
#define COMPLEX_NUMBER_

class ComplexNumber {
 public:
 ComplexNumber(double p_r, double p_i) : r(p_r), i(p_i) {
  }

  friend bool operator==(ComplexNumber const & c1, ComplexNumber const & c2);
  friend ComplexNumber operator+(ComplexNumber const & c1, ComplexNumber const & c2);

 private:
  double r;
  double i;
};

bool operator==(ComplexNumber const & c1, ComplexNumber const & c2) {
  if (c1.r == c2.r && c1.i == c2.i) 
    return true;
  return false;
}

ComplexNumber operator+(ComplexNumber const & c1,
			  ComplexNumber const & c2) {
  return ComplexNumber(c1.r + c2.r, c1.i + c2.i);
}

#endif

